<?php

namespace app\api\controller\intelligentlive;

use app\api\service\intelligentlive\SourceService;
use think\Request;

class Source
{
    protected $Service;
    public function __construct()
    {
        $this->Service = SourceService::getInstance();
    }

    public function addSource(Request $request)
    {
        $params = $request->post();
        $result = $this->Service->addSource($params);
        return writeJson(200,$result,"新增成功");
    }
    public function upSource(Request $request)
    {
        $params = $request->post();
        $result = $this->Service->upSource($params);
        return writeJson(200,$result,"更新成功");
    }

    public function delSource(Request $request)
    {
        $params = $request->post();
        $result = $this->Service->delSource($params);
        return writeJson(200,$result,"删除成功");
    }

    public function sourceList(Request $request)
    {
        $params = $request->post();
        $result = $this->Service->sourceList($params);
        return writeJson(200,$result,"获取成功");
    }
}